<?php

require_once BASE_PATH.'application/models/basedao'.EXT;

class mybabyDAO extends baseDAO {
	
	var $table = 'mybaby';
	var $key   = 'id_mybaby';
	var $sql   = '';

	function __construct()
	{
	    parent::__construct();
	}
	function _defaultSQL()
	{
		$this->db->select('id_mybaby, titulo, imagen, descripcion, tamano, peso');
	}

	function get_all($num_semana)
    {
        $this->_defaultSQL();
		$this->db->where('id_mybaby', $num_semana);
		$this->db->limit(1);
		$query = $this->db->get($this->table);
		return $query->result_array();
    }
	
    function get_last_row()
    {
        $this->_defaultSQL();
        $this->db->order_by('id_mybaby', 'DESC'); 
        $this->db->limit(1);
        $query = $this->db->get($this->table);
		return $query->result_array();
    }
    
    function get_last_id()
    {
        $this->db->select_max('id_mybaby');
        $this->db->limit(1);
        $query = $this->db->get($this->table);
		return $query->result_array();
    }
}

?>